import axios from 'axios';
import userListS from '../../staticData/userList';
import MockAdapter from 'axios-mock-adapter';

function userMock() {
    let mock = new MockAdapter(axios)
    let userList : any = []
    let index = 1
    for (let [key, value] of userListS.entries()) {
        userList.push({
            key : index++ ,
            username : key,
            password : value.password,
            permission : value.permission
        })
    }
    mock.onGet('/api/userlist').reply(200, userList)
}

export default userMock